<?php

/**
 * Description of AccountsControllerTest
 *
 * @author Abo El Seoud
 */
App::import('Model', 'Account');

class AccountsControllerTest extends ControllerTestCase {

    var $components = array('Cookie', 'Session', 'RequestHandler');

    public function startTest() {
        $this->Accounts = $this->generate('Accounts', array(
            'components' => array('Session', 'RequestHandler')));
        $this->Accounts->constructClasses();
        $this->Account = new Account();
    }
    
    /**
     * Tests getting the authorized account's followers
     *
     * @access: public
     *
     * @author "Hussein Abo El Seoud"
     */

    public function testFollowers() {
        $result = $this->testAction('/accounts/getFollowers/', array('method' => 'get', 'return' => 'vars'));
        $this->assertTrue(sizeof($result['ids']) > 0);
        $this->assertEquals(sizeof($result['accounts']), 1);
        $this->assertEquals(sizeof($result['images']), 1);
        $this->assertTrue($result['accountsLeftBox'] == true);
    }
	/*
     * @access: public
     * @param: null
     * @Description: This function tests the follow function.
     * @author Ahmed El-Fouly
     */
    public function testFollow() {
        $result = $this->testAction('/accounts/follow/RanaSaysHi/', array('method' => 'post'));
        $expected = true;
        $this->assertEquals($expected, $result);
    }
    /*
     * @access: public
     * @param: null
     * @Description: This function tests the unfollow function.
     * @author Ahmed El-Fouly
     */
    public function testunfollow() {
        $result = $this->testAction('/accounts/unfollow/RanaSaysHi/', array('method' => 'post'));
        $expected = true;
        $this->assertEquals($expected, $result);
    }

    function endTest() {
        unset($this->Accounts);
        ClassRegistry::flush();
    }

}

?>
